********************************************************************************
** 	TITLE:		us2004_anes_integrity				                          ** 	
**	AUTHOR:	    Review version                                                **
**	DATA:       anes2004TS                                                    **
**	DATE:		December 2022     				                              **	
**	VERSION:	Stata 16					                                  **	
********************************************************************************

* Version control

version 16.0

* Run poll file

do us2004_polls

* Open log file

capture log close       			  			              
log using "us2004_anes_integirty", replace

* Open the dataset

use "anes2004TS.dta", clear

* Election ID

gen election = "us2004-anes"


*********************************
** SATISFACTION WITH DEMOCRACY **
*********************************

* Satisfaction with democracy (post)

gen swd_post = V045241

recode swd_post 8=. 9=.

replace swd_post = 5 - swd_post

label define swd 1 "Not at all satisfied" 2 "Not very satisfied" 3 "Fairly satisfied" 4 "Satisfied"
label values swd_post swd


***********************
** ELECTION FAIRNESS **
***********************

gen integrity_5pts = V045042

recode integrity_5pts 8=. 9=.

replace integrity_5pts = 6 - integrity_5pts

gen integrity_4pts = integrity_5pts

recode integrity_4pts 2=1 3=2 4=3 5=4


***************************
** INDEPENDENT VARIABLES **
***************************

* Time

gen sdate = "2004" + V042008

gen surveydate = date(sdate,"YMD")

format %tdMon_DD,_CCYY surveydate

gen edate = 20041102

gen electiondate=date(string(edate,"%8.0f"),"YMD")

format %tdMon_DD,_CCYY electiondate

gen time = electiondate - surveydate

* Post-election date

gen pdate =  "2004" + V044004

gen podate = date(pdate,"YMD")

format %tdMon_DD,_CCYY podate

* Gender

gen male = V041109a

recode male 2=0

* Age

gen age = V043250

recode age 0=.

replace age = . if age < 18

* Education

gen education = V043254

recode education 0=.

* Postsecondary

gen postsecondary = 0 if education < 5
replace postsecondary = 1 if education >= 5

* Region

gen state = V041202

gen region = .

replace region = 1 if state == 09
replace region = 1 if state == 23
replace region = 1 if state == 25
replace region = 1 if state == 33
replace region = 1 if state == 44
replace region = 1 if state == 50
replace region = 1 if state == 34
replace region = 1 if state == 36
replace region = 1 if state == 42
replace region = 2 if state == 17
replace region = 2 if state == 18
replace region = 2 if state == 26
replace region = 2 if state == 39
replace region = 2 if state == 55
replace region = 2 if state == 19
replace region = 2 if state == 20
replace region = 2 if state == 27
replace region = 2 if state == 29
replace region = 2 if state == 31
replace region = 2 if state == 38
replace region = 2 if state == 46
replace region = 3 if state == 10
replace region = 3 if state == 11
replace region = 3 if state == 12
replace region = 3 if state == 13
replace region = 3 if state == 24
replace region = 3 if state == 37
replace region = 3 if state == 45
replace region = 3 if state == 51
replace region = 3 if state == 54
replace region = 3 if state == 01
replace region = 3 if state == 21
replace region = 3 if state == 28
replace region = 3 if state == 47
replace region = 3 if state == 05
replace region = 3 if state == 22
replace region = 3 if state == 40
replace region = 3 if state == 48
replace region = 4 if state == 04
replace region = 4 if state == 08
replace region = 4 if state == 16
replace region = 4 if state == 30
replace region = 4 if state == 32
replace region = 4 if state == 35
replace region = 4 if state == 49
replace region = 4 if state == 56
replace region = 4 if state == 02
replace region = 4 if state == 06
replace region = 4 if state == 15
replace region = 4 if state == 41
replace region = 4 if state == 53

label define region 1 "Northeast" 2 "Midwest" 3 "South" 4 "West"
label values region region

* Race

gen white = V043299

recode white 88=. 99=.

replace white = 0 if white!=50 & white!=.

recode white 50=1

* Income

gen income = V043293x

recode income 0=. 88=. 89=.

* Above average income

egen income_mean = mean(income)
egen income_sd = sd(income)
gen income_std = (income - income_mean)/income_sd

gen income_above = 0 if income_std < 0
replace income_above = 1 if income_std > 0

* Caring about outcome

gen care_whole = V043092

recode care_whole 3=0 8=.

* Closeness of election

gen closeness_whole = V043094

recode closeness_whole 88=. 99=. 11=0 12=0 14=0 25=1 26=1 29=1

* Party identification scale

gen pidscale = V043116

recode pidscale 7=. // Other minor party (only one respondent) recoded as missing data
recode pidscale 8=3 // Apolitical recoded as Independent
recode pidscale 9=. // NA recoded as missing data

replace pidscale = pidscale + 1

gen pidscale_whole = pidscale

label define pidscale 1 "Strong loser PID" 2 "Weak loser PID" 3 "Leaner loser PID" 4 "No PID" 5 "Leaner winner PID" 6 "Weak winner PID" 7 "Strong winner PID"
label values pidscale_whole pidscale

* Party identification

gen pid = pidscale

recode pid 4=0 2=1 3=1 5=3 6=3 7=3

label define pid 0 "Independent/Other" 1 "Democrat" 3 "Republican"
label values pid pid

* Party identification status

gen pidstatus_whole = pid

recode pidstatus_whole 0=2

label define pidstatus 1 "Loser PID" 2 "Independent/Other" 3 "Winner PID"
label values pidstatus_whole pidstatus

* Actual vote

gen voteact = V045026

recode voteact 9=.

replace voteact = 0 if V045017a == 5 | V045017b < 4 | V045018 == 5

label define voteact 0 "Not voted" 1 "John Kerry" 3 "George W. Bush" 5 "Ralph Nader" 7 "Other"
label values voteact voteact

* Actual vote status

gen voteactstatus_whole = .

replace voteactstatus_whole = 3 if voteact == 3
replace voteactstatus_whole = 2 if voteact == 0
replace voteactstatus_whole = 1 if voteact!=3 & voteact!=. & voteactstatus_whole!=2
 
label values voteactstatus_whole votestatus

* Democratic candidate rating

gen demrating = V043039

recode demrating 777=. 888=.

* Republican candidate rating

gen reprating = V043038

recode reprating 777=. 888=.

* Candidate preference

gen preference = 3 if reprating > demrating
replace preference = 1 if demrating > reprating

* Candidate preference status

gen prefstatus_whole = .

replace prefstatus_whole = 1 if reprating > demrating
replace prefstatus_whole = . if demrating == reprating
replace prefstatus_whole = 0 if demrating > reprating

label define prefstatus 0 "Loser preference" 1 "Winner preference"
label values prefstatus_whole prefstatus

* Dennis Hastert - Correct answer (Speaker of the House of Representatives) = 1, Incorrect answer = 0

gen hastert = V045162

recode hastert 5=0 8=0

* Dick Cheney - Correct answer (U.S. vice-president) = 1, Incorrect answer = 0

gen cheney = V045163

recode cheney 5=0 8=0

* Tony Blair - Correct answer (British Prime Minister) = 1, Incorrect answer = 0

gen blair = V045164

recode blair 5=0 8=0

* William Rehnquist - Correct answer (Supreme Court Chief Justice) = 1, Incorrect answer = 0

gen rehnquist = V045165

recode rehnquist 5=0 8=0

* Party with the most members in the U.S. House before election - Correct answer (Republican) = 1, Incorrect answer = 0

gen house = V045089

recode house 1=0 5=1 8=0

* Party with the most members in the U.S. Senate before election - Correct answer (Republican) = 1, Incorrect answer = 0

gen senate = V045090

recode senate 1=0 5=1 8=0

* Political knowledge index

gen knowledge = hastert + cheney + blair + rehnquist + house + senate

sum knowledge

gen knowledge_n = (knowledge - `r(min)') / (`r(max)'-`r(min)')

* Above average knowledge

egen knowledge_mean = mean(knowledge)
egen knowledge_sd = sd(knowledge)
gen knowledge_std = (knowledge - knowledge_mean)/knowledge_sd

gen knowledge_above = 0 if knowledge_std < 0
replace knowledge_above = 1 if knowledge_std > 0

* Economy (sociotropic)

gen econ_soc_ret = V043098 // Retrospective

recode econ_soc_ret 8=. 9=.

replace econ_soc_ret = 6 - econ_soc_ret

gen econ_soc_pro = V043100 // Prospective

recode econ_soc_pro 8=. 9=.

replace econ_soc_pro = 6 - econ_soc_pro

* Economy (egotropic)

gen econ_ego_ret = V043062 // Retrospective

recode econ_ego_ret 8=. 9=.

replace econ_ego_ret = 6 - econ_ego_ret

gen econ_ego_pro = V043064 // Prospective

recode econ_ego_pro 8=. 9=.

replace econ_ego_pro = 6 - econ_ego_pro

* Economy index (sociotropic)
 
gen economy_soc = econ_soc_ret + econ_soc_pro // Sociotropic economic evaluation additive index

sum economy_soc

replace economy_soc = (economy_soc - `r(min)') / (`r(max)'-`r(min)')

* Economy index (egotropic)
 
gen economy_ego = econ_ego_ret + econ_ego_pro // Egotropic economic evaluation additive index

sum economy_ego

replace economy_ego = (economy_ego - `r(min)') / (`r(max)'-`r(min)')

* Public officials don't care (post)

gen dontcare_post = V045201

recode dontcare_post 8=. 9=.

replace dontcare_post = 6 - dontcare_post

* Trust government to do right thing (post)

gen govtright_post = V045197

recode govtright_post 8=.

* Waste money (post)

gen waste_post = V045199

recode waste_post 1=3 3=2 5=1 8=. 9=.

* Big interests (post)

gen biginterests_post = V045198

recode biginterests_post 1=2 5=1 8=. 9=.

* Crooked (post)

gen crooked_post = V045200

recode crooked_post 1=3 3=2 5=1 8=. 9=.

* Governement attention (post)

gen govtatt_post = V045203

recode govtatt_post 1=3 3=2 5=1 8=. 9=.

* Difference who is in power (post)

gen diffpower_post = V045242

recode diffpower_post 8=.

replace diffpower_post = 6 - diffpower_post

* Political cynicism (post)

gen cynicism_post = dontcare_post + govtright_post + waste_post + biginterests_post + crooked_post + govtatt_post + diffpower_post // Political cynicism index

sum cynicism_post

gen cynicism_post_n = (cynicism_post - `r(min)') / (`r(max)'-`r(min)')

* Social mistrust

gen people = V045186

recode people 1=0 5=1 8=. 9=.

* Survey weight

gen weight = V040102


******************
** EXPECTATIONS **
******************

* Forecasts (1 = Democrat, 3 = Republican, 7 = other)

gen forecast_whole = V043093

recode forecast_whole (9=.)

* Identify correct forecasts

gen correct_whole_d = 0 if forecast_whole!=3 & forecast_whole!=.
replace correct_whole_d = 1 if forecast_whole == 3

* Mean of correct forecasts by day

bysort time : egen correct_mean = mean(correct_whole_d)

* PID matches forecast

gen match = .

replace match = 1 if pid == 1 & forecast_whole == 1
replace match = 1 if pid == 3 & forecast_whole == 3
replace match = 0 if pid == 1 & forecast_whole == 3
replace match = 0 if pid == 3 & forecast_whole == 1

* Consistency (PID)

gen dissonant_p = .

replace dissonant_p = 0 if pid == 1 & forecast_whole == 1
replace dissonant_p = 1 if pid == 1 & forecast_whole == 3
replace dissonant_p = 1 if pid == 1 & forecast_whole == 7

replace dissonant_p = 0 if pid == 3 & forecast_whole == 3
replace dissonant_p = 1 if pid == 3 & forecast_whole == 1
replace dissonant_p = 1 if pid == 3 & forecast_whole == 7

* Consistency (vote)

gen dissonant_v = .

replace dissonant_v = 0 if voteact == 1 & forecast_whole == 1
replace dissonant_v = 1 if voteact == 1 & forecast_whole == 3
replace dissonant_v = 1 if voteact == 1 & forecast_whole == 7

replace dissonant_v = 0 if voteact == 3 & forecast_whole == 3
replace dissonant_v = 1 if voteact == 3 & forecast_whole == 1
replace dissonant_v = 1 if voteact == 3 & forecast_whole == 7


******************************
** RESPONDENTS' STATUS: PID **
******************************

* PID (all respondents)

gen unxloser_whole_p = 1 if pid == forecast_whole & pidstatus_whole == 1 & pid!=. // Unexpected losers

gen exploser_whole_p = 1 if pid!=forecast_whole & pidstatus_whole == 1 & pid!=. // Expected losers

gen unxwinner_whole_p = 1 if pid!=forecast_whole & pidstatus_whole == 3 & pid!=. // Unexpected winners

gen expwinner_whole_p = 1 if pid == forecast_whole & pidstatus_whole == 3 & pid!=. // Expected winners

gen nopid = 1 if pid == 0 // No PID

replace unxloser_whole_p = 0 if exploser_whole_p == 1 | unxwinner_whole_p == 1 | expwinner_whole_p == 1 | nopid == 1
replace exploser_whole_p = 0 if unxloser_whole_p == 1 | unxwinner_whole_p == 1 | expwinner_whole_p == 1 | nopid == 1
replace unxwinner_whole_p = 0 if unxloser_whole_p == 1 | exploser_whole_p == 1 | expwinner_whole_p == 1 | nopid == 1
replace expwinner_whole_p = 0 if unxloser_whole_p == 1 | exploser_whole_p == 1 | unxwinner_whole_p == 1 | nopid == 1
replace nopid = 0 if pid!=0 & pid!=.

gen status_whole_p = .

replace status_whole_p = 1 if unxloser_whole_p == 1
replace status_whole_p = 2 if exploser_whole_p == 1
replace status_whole_p = 3 if nopid == 1
replace status_whole_p = 4 if expwinner_whole_p == 1
replace status_whole_p = 5 if unxwinner_whole_p == 1
replace status_whole_p = . if pid == . | forecast_whole == .

* PID (excluding independents/others)

gen status_whole_p_noind = status_whole_p

replace status_whole_p_noind = . if pid == 0

* Generate binary variable for unexpected outcomes

gen unexpected_p = 0 if status_whole_p == 2 | status_whole_p == 4 | status_whole_p == 3 & correct_whole_d == 1
replace unexpected_p = 1 if status_whole_p == 1 | status_whole_p == 5 | status_whole_p == 3 & correct_whole_d == 0


*******************************
** RESPONDENTS' STATUS: VOTE **
*******************************

* Actual vote

gen unxloser_whole_v = 1 if voteact == forecast_whole & voteactstatus_whole == 1 & voteact!=. // Unexpected losers

gen exploser_whole_v = 1 if voteact!=forecast_whole & voteactstatus_whole == 1 & voteact!=. // Expected losers

gen unxwinner_whole_v = 1 if voteact!=forecast_whole & voteactstatus_whole == 3 & voteact!=. // Unexpected winners

gen expwinner_whole_v = 1 if voteact == forecast_whole & voteactstatus_whole == 3 & voteact!=. // Expected winners

gen novoteact = 1 if voteact == 0 // No vote

replace unxloser_whole_v = 0 if exploser_whole_v == 1 | unxwinner_whole_v == 1 | expwinner_whole_v == 1 | novoteact == 1
replace exploser_whole_v = 0 if unxloser_whole_v == 1 | unxwinner_whole_v == 1 | expwinner_whole_v == 1 | novoteact == 1
replace unxwinner_whole_v = 0 if unxloser_whole_v == 1 | exploser_whole_v == 1 | expwinner_whole_v == 1 | novoteact == 1
replace expwinner_whole_v = 0 if unxloser_whole_v == 1 | exploser_whole_v == 1 | unxwinner_whole_v == 1 | novoteact == 1
replace novoteact = 0 if voteact!=0 & voteact!=.

gen status_whole_v = .

replace status_whole_v = 1 if unxloser_whole_v == 1
replace status_whole_v = 2 if exploser_whole_v == 1
replace status_whole_v = 3 if novoteact == 1
replace status_whole_v = 4 if expwinner_whole_v == 1
replace status_whole_v = 5 if unxwinner_whole_v == 1
replace status_whole_v = . if voteact == . | forecast_whole == .

* Generate binary variable for unexpected outcomes

gen unexpected_v = 0 if status_whole_v == 2 | status_whole_v == 4 | status_whole_v == 3 & correct_whole_d == 1
replace unexpected_v = 1 if status_whole_v == 1 | status_whole_v == 5 | status_whole_v == 3 & correct_whole_d == 0


*************************************
** RESPONDENTS' STATUS: PREFERENCE **
*************************************

* Candidate preference

gen unxloser_whole_r = 1 if preference == forecast_whole & prefstatus_whole == 0 & preference!=. // Unexpected losers

gen exploser_whole_r = 1 if preference!=forecast_whole & prefstatus_whole == 0 & preference!=. // Expected losers

gen unxwinner_whole_r = 1 if preference!=forecast_whole & prefstatus_whole == 1 & preference!=. // Unexpected winners

gen expwinner_whole_r = 1 if preference == forecast_whole & prefstatus_whole == 1 & preference!=. // Expected winners

replace unxloser_whole_r = 0 if exploser_whole_r == 1 | unxwinner_whole_r == 1 | expwinner_whole_r == 1
replace exploser_whole_r = 0 if unxloser_whole_r == 1 | unxwinner_whole_r == 1 | expwinner_whole_r == 1
replace unxwinner_whole_r = 0 if unxloser_whole_r == 1 | exploser_whole_r == 1 | expwinner_whole_r == 1
replace expwinner_whole_r = 0 if unxloser_whole_r == 1 | exploser_whole_r == 1 | unxwinner_whole_r == 1

gen status_whole_r = .

replace status_whole_r = 1 if unxloser_whole_r == 1
replace status_whole_r = 2 if exploser_whole_r == 1
replace status_whole_r = 3 if expwinner_whole_r == 1
replace status_whole_r = 4 if unxwinner_whole_r == 1
replace status_whole_r = . if voteact == . | forecast_whole == .

* Generate binary variable for unexpected outcomes

gen unexpected_r = 0 if status_whole_r == 2 | status_whole_r == 3
replace unexpected_r = 1 if status_whole_r == 1 | status_whole_r == 4


**************************
** MERGE WITH POLL DATA **
**************************

* Merge

nearmrg using "us2000_polls.dta", lower nearvar(time)
drop _merge

* Congruent polling information

gen congruent = .

replace congruent = 1 if ahead_mean3 == 1 & forecast_whole == 1
replace congruent = 1 if ahead_mean3 == 2 & forecast_whole == 1 & pollmar_mean3 <= 2
replace congruent = 0 if ahead_mean3 == 2 & forecast_whole == 1 & pollmar_mean3 > 2

replace congruent = 1 if ahead_mean3 == 2 & forecast_whole == 3
replace congruent = 1 if ahead_mean3 == 1 & forecast_whole == 3 & pollmar_mean3 <= 2
replace congruent = 0 if ahead_mean3 == 1 & forecast_whole == 3 & pollmar_mean3 > 2


**********************
** SELECT VARIABLES **
**********************

* Keep needed variables

keep election podate integrity_5pts integrity_4pts swd_post match pid pidstatus_whole pidscale_whole voteactstatus_whole prefstatus_whole unexpected_p unexpected_v unexpected_r economy_soc economy_ego cynicism_post_n people knowledge knowledge_n knowledge_above male white age income income_above education postsecondary region closeness_whole care_whole correct_whole_d correct_mean time dissonant_p dissonant_v congruent pollmar_mean3 weight


**********
** SAVE **
**********

save "us2004_anes_integrity.dta", replace


************
** TABLES **
************

* Party identification

eststo: regress integrity_4pts i.pidstatus_whole knowledge_n i.male i.white age income education i.region [pweight=weight]
eststo: regress swd_post i.pidstatus_whole economy_ego economy_soc knowledge_n i.male i.white age income education i.region [pweight=weight]
eststo: regress integrity_4pts i.pidstatus_whole##i.unexpected_p knowledge_n i.male i.white age income education i.region [pweight=weight]
eststo: regress swd_post i.pidstatus_whole##i.unexpected_p economy_ego economy_soc knowledge_n i.male i.white age income education i.region [pweight=weight]

esttab using "us2004_anes_integrity_pid.tex", alignment(ll) substitute({table} {table*} \begin{tabular*} \small\begin{tabular*}) wide drop(0.male 1.male 0.white 1.white age income education 1.region 2.region 3.region 4.region 0.unexpected_p 1.pidstatus_whole#0.unexpected_p 2.pidstatus_whole#0.unexpected_p 3.pidstatus_whole#0.unexpected_p 1.pidstatus_whole#1.unexpected_p) refcat(1.pidstatus_whole "\textbf{\textit{Electoral status}}" 1.unexpected_p "\textbf{\textit{Unexpected outcome?}}" 2.pidstatus_whole#1.unexpected_p "\textbf{\textit{2-way interaction}}" economy_ego "\textbf{\textit{Economic evaluations}}" knowledge_n "\textbf{\textit{Information}}", nolabel) width(\hsize) pr2(2) b(2) not star(+ 0.10 * 0.05 ** 0.01 *** 0.001) label mtitles("FAIR" "SWD" "FAIR" "SWD") interaction("$\times$")style(tex) replace booktabs varlabels(_cons "\textbf{\textit{Constant}}" 1.pidstatus_whole "\hspace{1em} Loser (R)" 2.pidstatus_whole "\hspace{1em} Independent" 3.pidstatus_whole "\hspace{1em} Winner" 1.unexpected_p "\hspace{1em} Yes" 2.pidstatus_whole#1.unexpected_p "\hspace{1em} Independent $\times$ Unexpected" 3.pidstatus_whole#1.unexpected_p "\hspace{1em} Winner $\times$ Unexpected" knowledge_n "\hspace{1em} Political knowledge" economy_ego "\hspace{1em} Egotropic" economy_soc "\hspace{1em} Sociotropic" ) order(1.pidstatus_whole 2.pidstatus_whole 3.pidstatus_whole 1.unexpected_p 2.pidstatus_whole#1.unexpected_p 3.pidstatus_whole#1.unexpected_p economy_ego economy_soc knowledge_n) stats(N r2, labels("Observations" "\textit{R}\textsuperscript{2}") fmt(%9.0fc %9.2fc)) nonotes title("Perceived Electoral Integrity and Satisfaction with Democracy, 2004 U.S. Presidential Election")

eststo clear

* Reported vote

eststo: regress integrity_4pts i.voteactstatus_whole knowledge_n i.male i.white age income education i.region [pweight=weight]
eststo: regress swd_post i.voteactstatus_whole economy_ego economy_soc knowledge_n i.male i.white age income education i.region [pweight=weight]
eststo: regress integrity_4pts i.voteactstatus_whole##i.unexpected_v knowledge_n i.male i.white age income education i.region [pweight=weight]
eststo: regress swd_post i.voteactstatus_whole##i.unexpected_v economy_ego economy_soc knowledge_n i.male i.white age income education i.region [pweight=weight]

esttab using "us2004_anes_integrity_vote.tex", alignment(ll) substitute({table} {table*} \begin{tabular*} \small\begin{tabular*}) wide drop(0.male 1.male 0.white 1.white age income education 1.region 2.region 3.region 4.region 0.unexpected_v 1.voteactstatus_whole#0.unexpected_v 2.voteactstatus_whole#0.unexpected_v 3.voteactstatus_whole#0.unexpected_v 1.voteactstatus_whole#1.unexpected_v) refcat(1.voteactstatus_whole "\textbf{\textit{Electoral status}}" 1.unexpected_v "\textbf{\textit{Unexpected outcome?}}" 2.voteactstatus_whole#1.unexpected_v "\textbf{\textit{2-way interaction}}" economy_ego "\textbf{\textit{Economic evaluations}}" knowledge_n "\textbf{\textit{Information}}", nolabel) width(\hsize) pr2(2) b(2) not star(+ 0.10 * 0.05 ** 0.01 *** 0.001) label mtitles("FAIR" "SWD" "FAIR" "SWD") interaction("$\times$")style(tex) replace booktabs varlabels(_cons "\textbf{\textit{Constant}}" 1.voteactstatus_whole "\hspace{1em} Loser (R)" 2.voteactstatus_whole "\hspace{1em} Non-voter" 3.voteactstatus_whole "\hspace{1em} Winner" 1.unexpected_v "\hspace{1em} Yes" 2.voteactstatus_whole#1.unexpected_v "\hspace{1em} Non-voter $\times$ Unexpected" 3.voteactstatus_whole#1.unexpected_v "\hspace{1em} Winner $\times$ Unexpected" knowledge_n "\hspace{1em} Political knowledge" economy_ego "\hspace{1em} Egotropic" economy_soc "\hspace{1em} Sociotropic" ) order(1.voteactstatus_whole 2.voteactstatus_whole 3.voteactstatus_whole 1.unexpected_v 2.voteactstatus_whole#1.unexpected_v 3.voteactstatus_whole#1.unexpected_v economy_ego economy_soc knowledge_n) stats(N r2, labels("Observations" "\textit{R}\textsuperscript{2}") fmt(%9.0fc %9.2fc)) nonotes title("Perceived Electoral Integrity and Satisfaction with Democracy, 2004 U.S. Presidential Election")

eststo clear

* Party identification, Political cynicism

eststo: regress integrity_4pts i.pidstatus_whole##i.unexpected_p knowledge_n i.male i.white age income education i.region [pweight=weight]
eststo: regress integrity_4pts i.pidstatus_whole##i.unexpected_p cynicism_post_n i.people knowledge_n i.male i.white age income education i.region [pweight=weight]
eststo: regress swd_post i.pidstatus_whole##i.unexpected_p economy_ego economy_soc knowledge_n i.male i.white age income education i.region [pweight=weight]
eststo: regress swd_post i.pidstatus_whole##i.unexpected_p cynicism_post_n i.people economy_ego economy_soc knowledge_n i.male i.white age income education i.region [pweight=weight]

esttab using "us2004_anes_integrity_cynicism_pid.tex", alignment(ll) substitute({table} {table*} \begin{tabular*} \small\begin{tabular*}) wide drop(0.male 1.male 0.white 1.white age income education 1.region 2.region 3.region 4.region 0.unexpected_p 1.pidstatus_whole#0.unexpected_p 2.pidstatus_whole#0.unexpected_p 3.pidstatus_whole#0.unexpected_p 1.pidstatus_whole#1.unexpected_p 0.people) refcat(1.pidstatus_whole "\textbf{\textit{Electoral status}}" 1.unexpected_p "\textbf{\textit{Unexpected outcome?}}" 2.pidstatus_whole#1.unexpected_p "\textbf{\textit{2-way interaction}}"  cynicism_post_n "\textbf{\textit{Suspicious thinking}}" economy_ego "\textbf{\textit{Economic evaluations}}" knowledge_n "\textbf{\textit{Information}}", nolabel) width(\hsize) pr2(2) b(2) not star(+ 0.10 * 0.05 ** 0.01 *** 0.001) label mtitles("Without" "With" "Without" "With") interaction("$\times$")style(tex) replace booktabs varlabels(_cons "\textbf{\textit{Constant}}" 1.pidstatus_whole "\hspace{1em} Loser (R)" 2.pidstatus_whole "\hspace{1em} Independent" 3.pidstatus_whole "\hspace{1em} Winner" 1.unexpected_p "\hspace{1em} Yes" 2.pidstatus_whole#1.unexpected_p "\hspace{1em} Independent $\times$ Unexpected" 3.pidstatus_whole#1.unexpected_p "\hspace{1em} Winner $\times$ Unexpected" knowledge_n "\hspace{1em} Political knowledge" economy_ego "\hspace{1em} Egotropic" economy_soc "\hspace{1em} Sociotropic" cynicism_post_n "\hspace{1em} Political cynicism" 1.people "\hspace{1em} Social mistrust") order(1.pidstatus_whole 2.pidstatus_whole 3.pidstatus_whole 1.unexpected_p 2.pidstatus_whole#1.unexpected_p 3.pidstatus_whole#1.unexpected_p cynicism_post_n 1.people economy_ego economy_soc knowledge_n) stats(N r2, labels("Observations" "\textit{R}\textsuperscript{2}") fmt(%9.0fc %9.2fc)) nonotes title("Perceived Electoral Integrity and Satisfaction with Democracy, 2004 U.S. Presidential Election")

eststo clear

* Reported vote, Political cynicism

eststo: regress integrity_4pts i.voteactstatus_whole##i.unexpected_v knowledge_n i.male i.white age income education i.region [pweight=weight]
eststo: regress integrity_4pts i.voteactstatus_whole##i.unexpected_v cynicism_post_n i.people knowledge_n i.male i.white age income education i.region [pweight=weight]
eststo: regress swd_post i.voteactstatus_whole##i.unexpected_v economy_ego economy_soc knowledge_n i.male i.white age income education i.region [pweight=weight]
eststo: regress swd_post i.voteactstatus_whole##i.unexpected_v cynicism_post_n i.people economy_ego economy_soc knowledge_n i.male i.white age income education i.region [pweight=weight]

esttab using "us2004_anes_integrity_cynicism_vote.tex", alignment(ll) substitute({table} {table*} \begin{tabular*} \small\begin{tabular*}) wide drop(0.male 1.male 0.white 1.white age income education 1.region 2.region 3.region 4.region 0.unexpected_v 1.voteactstatus_whole#0.unexpected_v 2.voteactstatus_whole#0.unexpected_v 3.voteactstatus_whole#0.unexpected_v 1.voteactstatus_whole#1.unexpected_v 0.people) refcat(1.voteactstatus_whole "\textbf{\textit{Electoral status}}" 1.unexpected_v "\textbf{\textit{Unexpected outcome?}}" 2.voteactstatus_whole#1.unexpected_v "\textbf{\textit{2-way interaction}}" cynicism_post_n "\textbf{\textit{Suspicious thinking}}" economy_ego "\textbf{\textit{Economic evaluations}}" knowledge_n "\textbf{\textit{Information}}", nolabel) width(\hsize) pr2(2) b(2) not star(+ 0.10 * 0.05 ** 0.01 *** 0.001) label mtitles("Without" "With" "Without" "With") interaction("$\times$")style(tex) replace booktabs varlabels(_cons "\textbf{\textit{Constant}}" 1.voteactstatus_whole "\hspace{1em} Loser (R)" 2.voteactstatus_whole "\hspace{1em} Non-voter" 3.voteactstatus_whole "\hspace{1em} Winner" 1.unexpected_v "\hspace{1em} Yes" 2.voteactstatus_whole#1.unexpected_v "\hspace{1em} Non-voter $\times$ Unexpected" 3.voteactstatus_whole#1.unexpected_v "\hspace{1em} Winner $\times$ Unexpected" knowledge_n "\hspace{1em} Political knowledge" economy_ego "\hspace{1em} Egotropic" economy_soc "\hspace{1em} Sociotropic" cynicism_post_n "\hspace{1em} Political cynicism" 1.people "\hspace{1em} Social mistrust") order(1.voteactstatus_whole 2.voteactstatus_whole 3.voteactstatus_whole 1.unexpected_v 2.voteactstatus_whole#1.unexpected_v 3.voteactstatus_whole#1.unexpected_v cynicism_post_n 1.people economy_ego economy_soc knowledge_n) stats(N r2, labels("Observations" "\textit{R}\textsuperscript{2}") fmt(%9.0fc %9.2fc)) nonotes title("Perceived Electoral Integrity and Satisfaction with Democracy, 2004 U.S. Presidential Election")

eststo clear

log close